package com.oracle.sbdb.util;

import java.util.HashMap;
import java.util.Map;

public class SeverityUtil {
	private static final Map<Integer, String> int2string = loadData();
	private static final Map<String, Integer> string2int = loadString2Int();
	private static Map<Integer, String> loadData() {
		Map<Integer, String> res = new HashMap<Integer, String>();
		res.put(1, "Complete Loss of Service");
		res.put(2, "Severe Loss of Service");
		res.put(3, "Minimal Loss of Service");
		res.put(4, "Minor Error, No Loss of Service");
		return res;
	}
	private static Map<String, Integer> loadString2Int() {
		Map<String, Integer> res = new HashMap<String, Integer>();
		for(Integer key : int2string.keySet()){
			String value = int2string.get(key);
			res.put(value, key);
		}
		return res;
	}
	public static String getSeverity(int severity){
		return int2string.get(severity);
	}
	public static int getSeverityNumber(String severity){
		return string2int.get(severity);
	}
}
